<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<link rel="stylesheet" type="text/css" href="css/header.css"/>
<link rel="stylesheet" href="css/iconfont.css" />
<!-- 注册模态框（Modal） -->
<div class="modal fade" id="myModal_zhuce" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" 
							aria-hidden="true">
					</button>
					<h4 class="modal-title" id="welcome">
						注册
					</h4>
				</div>
				<button type="button" class="close" data-dismiss="modal" 
						aria-hidden="true">
				</button>
				<h4 class="modal-title" id="myModalLabel">
					<ul id="myTab" class="nav nav-tabs">
						<li class="active">
							<a href="#home" data-toggle="tab">
								注册学生账号
							</a>
						</li>
						<li>
							<a href="#ios" data-toggle="tab">注册发布方账号</a>
						</li>
					</ul>
					<div id="myTabContent" class="tab-content">
						<div class="tab-pane fade in active" id="home">
							<form id="studentRegisterForm" action="<%=path%>/account/Account_register.action" method="post" class="form-horizontal" role="form">
								    <div class="form-group">
								    	<label for="firstname" class="col-sm-3 control-label">学生邮箱</label>
									    <div class="col-sm-9">
									      <input required type="email" name="email" class="form-control" id="firstname" placeholder="请输入学生个人邮箱">
									    </div>
									</div>
									
									<div class="form-group">
									    <label for="lastname" class="col-sm-3 control-label">设置密码</label>
									    <div class="col-sm-9">
									      <input required type="password" name="password" class="form-control" id="password1" placeholder="请输入密码">
									    </div>
									</div>
									<div class="form-group">
									    <label for="lastname" class="col-sm-3 control-label">确认密码</label>
									    <div class="col-sm-9">
									      <input required type="password" name="confirm_password" class="form-control" id="password2" placeholder="请再次输入密码">
									    </div>
									</div>
									<div class="form-group">
									    <div class="col-sm-offset-2 col-sm-10">
									      <div class="checkbox">
									        <label>
									          <input type="checkbox" required>已阅读并同意 
									          <span style="color: mediumspringgreen;">《i竞赛服务协议》</span>
									        </label>
									      </div>
									    </div>
									</div>
									<div class="modal-body">
										按下 ESC 按钮或点击外部退出。
									</div>
									<div class="modal-footer">
										<input class="sumitBtn" type="submit" onclick="checkPasswords1()" value="注册">
									</div>
								</form>
						</div>
						<div class="tab-pane fade" id="ios">
							<form name="sponsorRegisterForm" action="<%=path%>/sponsor/Sponsor_register.action" method="post" class="form-horizontal" role="form">
							    <div class="form-group">
							    	<label for="firstname" class="col-sm-3 control-label">官方邮箱</label>
							   		<div class="col-sm-9">
								      <input name="sponsorEmail" required type="email" class="form-control" id="firstname" placeholder="请输入发布方官方邮箱">
								    </div>
								</div>
								<div class="form-group">
							    	<label for="firstname" class="col-sm-3 control-label">官方名称</label>
							   		<div class="col-sm-9">
								      <input name="sponsorName" required type="text" class="form-control" id="firstname" placeholder="请输入您发布时候使用的名称">
								    </div>
								</div>
								<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">官方密码</label>
								    <div class="col-sm-9">
								      <input name="sponsorPassword" required type="password" class="form-control" id="pass1" placeholder="请输入密码">
								    </div>
								</div>
								<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">确认密码</label>
								    <div class="col-sm-9">
								      <input required type="password" class="form-control" id="pass2" placeholder="请再次输入密码">
								    </div>
								</div>
								<div class="form-group">
								    <div class="col-sm-offset-2 col-sm-10">
								      <div class="checkbox">
								        <label>
								          <input required type="checkbox" required>已阅读并同意 
								          <span style="color: mediumspringgreen;">《i竞赛服务协议》</span>
								        </label>
								      </div>
								    </div>
								</div>
								<div class="modal-body">
									按下 ESC 按钮或点击外部退出。
								</div>
								<div class="modal-footer">
									<input class="sumitBtn" type="submit" onclick="checkPasswords2()" value="注册">
								</div>
							</form>
						</div>
					</div>
				</h4>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 登陆模态框（Modal） -->
<div class="modal fade" id="myModal_denglu" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" 
							aria-hidden="true">
					</button>
					<h4 class="modal-title" id="welcome">
						欢迎来到 i竞赛
					</h4>
				</div>
				<button type="button" class="close" data-dismiss="modal" 
						aria-hidden="true">
				</button>
				<h4 class="modal-title" id="myModalLabel">
					<ul id="myTab" class="nav nav-tabs">
						<li class="active">
							<a href="#home1" data-toggle="tab">
								学生账号登陆
							</a>
						</li>
						<li>
							<a href="#ios1" data-toggle="tab">发布方账号登陆</a>
						</li>
					</ul>
					<div id="myTabContent" class="tab-content">
						<div class="tab-pane fade in active" id="home1">
							<form name="studentLoginForm" action="<%=path%>/account/Account_login.action" method="post" class="form-horizontal" role="form">
										     <div class="form-group">
							    	<label for="firstname" class="col-sm-3 control-label">邮箱</label>
							    <div class="col-sm-9">
							      <input name="email" required type="email" class="form-control" id="firstname" placeholder="学生邮箱/官方邮箱">
							    </div>
								</div>
								<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">密码</label>
								    <div class="col-sm-9">
								      <input name="password" required type="password" class="form-control" id="lastname" placeholder="请输入密码">
								    </div>
								</div>
								<div class="form-group">
								    <div class="col-sm-offset-2 col-sm-10">
								      <div class="checkbox">
								        <label>
								          <input type="checkbox">记住密码 
								        </label>
								      </div>
								    </div>
								</div>
								<div class="modal-body">
									按下 ESC 按钮或点击外部退出。
								</div>
								<div class="modal-footer">
									<input class="sumitBtn" type="submit"  value="登陆">
								</div>
							</form>
						</div>
						<div class="tab-pane fade" id="ios1">
							<form name="sponsorLoginForm" action="<%=path%>/sponsor/Sponsor_login.action" method="post" class="form-horizontal" role="form">
										     <div class="form-group">
							    	<label for="firstname" class="col-sm-3 control-label">官方邮箱</label>
							    <div class="col-sm-9">
							      <input name="sponsorEmail" required type="email" class="form-control" id="firstname" placeholder="发布方邮箱/学生邮箱">
							    </div>
								</div>
								<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">官方密码</label>
								    <div class="col-sm-9">
								      <input name="sponsorPassword" required type="password" class="form-control" id="lastname" placeholder="请输入密码">
								    </div>
								</div>
								<div class="form-group">
								    <div class="col-sm-offset-2 col-sm-10">
								      <div class="checkbox">
								        <label>
								          <input type="checkbox">记住密码 
								        </label>
								      </div>
								    </div>
								</div>
								<div class="modal-body">
									按下 ESC 按钮或点击外部退出。
								</div>
								<div class="modal-footer">
									<input class="sumitBtn" type="submit"  value="登陆">
								</div>
							</form>
						</div>
					</div>
				</h4>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 主页内容容器 -->
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
				<div class="navbar-header">
					 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> 
					 	<span class="sr-only">Toggle navigation</span>
					 	<span class="icon-bar"></span>
					 	<span class="icon-bar"></span>
					 	<span class="icon-bar"></span>
					 </button> 
					 <a class="navbar-brand" href="#">
					 	<span class="iconfont icon-i" style="color: #5BC0DE;">
					 	<span style="color: blueviolet;margin-left: -16px;">竞赛</span>
					 </a>
				</div>
				
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li><a href="index.jsp"><span class="iconfont icon-shouye1" style="color: blue;"></span> 首页</a></li> 
			            <li><a href="contest.jsp"><span class="iconfont icon--jingsai" style="color: darkorange;"></span>竞赛</a></li>
			            <li><a href="#"><span class="iconfont icon-xueyuan" style="color: black;"></span>学院</a></li>
			            <li><a href="#"><span class="iconfont icon-huodong" style="color: brown;"></span>活动</a></li>
			            <li><a href="#"><span class="iconfont icon-shequ" style="color: darkorange;"></span>社区</a></li>
						<li class="dropdown">
							 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
							 	<span class="iconfont icon-remen" style="color: red;"></span>
							 	热门<strong class="caret"></strong>
							 </a>
							<ul class="dropdown-menu">
								<li>
									 <a href="#">全国竞赛</a>
								</li>
								<li>
									 <a href="#">省级竞赛</a>
								</li>
								<li>
									 <a href="#">竞赛排行</a>
								</li>
								<li class="divider">
								</li>
								<li>
									 <a href="#">其他热门竞赛</a>
								</li>
							</ul>
						</li>
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown">
							 	<span class="iconfont icon-chuangjianxiangmu" style="color: darkturquoise;"></span>
							 	发布<strong class="caret"></strong>
							</a>
							<ul class="dropdown-menu">
								<li>
									 <a href="#">发布竞赛</a>
								</li>
								<li>
									 <a href="#">发布活动</a>
								</li>
								<li>
									 <a href="#">提交意见</a>
								</li>
								<li class="divider">
								</li>
								<li>
									 <a href="#">联系我们</a>
								</li>
							</ul>
						</li>	
					</ul>
					<form class="navbar-form navbar-left" role="search" id="query" method="post" action="search.jsp?currentPage=1">
						<div class="input-group">
						    <div class="input-icon-group">
						        <input name="searchKeyword" id="inputQuery" type="text" class="form-control fc-clear" placeholder="搜索比赛"/> 
						    </div>
						    <span class="input-group-btn">
						        <input style="font-size:18px;margin-top:-3px;margin-left:4px;"  class="sumitBtn" type="submit"  value="GO">
						    </span>
						</div>
					</form>
					<s:if test="%{#session.loginAccount==null and #session.loginSponsor==null }">
						<ul class="nav navbar-nav navbar-right" id="zhuce_denglu">
					      <li>
					      	<!-- 按钮触发模态框 -->
							<a href="#" data-toggle="modal" data-target="#myModal_zhuce">
								<span class="iconfont icon-zhuce"></span>
					      		注册
							</a>
					      </li>
					      <li>
					      	<!-- 按钮触发模态框 -->
							<a href="#" data-toggle="modal" data-target="#myModal_denglu">
								<span class="iconfont icon-denglu"></span>
					      		登陆
							</a>
					      </li>
					    </ul>
					</s:if>
					
					<s:if test="%{#session.loginAccount!=null}">
						<div class="dropdown" id="loginSuccess">
						    <button type="button" class="btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">
						    	<span class="iconfont icon-xueshengpiao" style="color: blue;font-size:24px;"></span>
								 	<span>${sessionScope.loginAccount.accountName}</span>
								<strong class="caret"></strong>
						    </button>
						    <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="#">
						            	<span class="iconfont icon--jingsai-press login_icon"></span>我的竞赛
						            </a>
						        </li>
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="#">
						            	<span class="iconfont icon-huodong1 login_icon"></span>我的活动
						            </a>
						        </li>
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="#">
						            	<span class="iconfont icon-xueyuan1 login_icon"></span>我的学院
						            </a>
						        </li>
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="personal_page.jsp">
						            	<span class="iconfont icon-bianji login_icon"></span>个人中心
						            </a>
						        </li>
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="<%=path%>/account/Account_logout.action">
						            	<span class="iconfont icon-tuichu login_icon"></span>退出登陆
						            </a>
						        </li>
						    </ul>
						</div>
					</s:if>
					
					<s:if test="%{#session.loginSponsor!=null}">
						<div class="dropdown" id="loginSuccess">
						    <button type="button" class="btn dropdown-toggle" id="dropdownMenu2" data-toggle="dropdown">
						    	<span class="iconfont icon-guanfang2" style="color: red;font-size:24px;"></span>
								<span>${sessionScope.loginSponsor.sponsorName}</span>
								<strong class="caret"></strong>
						    </button>
						    <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="publishContest.jsp	">
						            	<span class="iconfont icon-chuangjian login_icon"></span>创建竞赛
						            </a>
						        </li>
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="#">
						            	<span class="iconfont icon-lecing_yichuangjian login_icon"></span>已创建的竞赛
						            </a>
						        </li>
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="#">
						            	<span class="iconfont icon-zhaomuhui login_icon"></span>招募
						            </a>
						        </li>
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="sponsor_page.jsp">
						            	<span class="iconfont icon-bianji login_icon"></span>个人中心
						            </a>
						        </li>
						        <li role="presentation">
						            <a role="menuitem" tabindex="-1" href="<%=path%>/account/Sponsor_logout.action">
						            	<span class="iconfont icon-tuichu login_icon"></span>退出登陆
						            </a>
						        </li>
						    </ul>
						</div>
					</s:if>
				</div>
			</nav>
		</div>
	</div>
</div>
<script>
	function checkPasswords1() {
       	var pass1 = document.getElementById("password1");
      		var pass2 = document.getElementById("password2");
	    if (pass1.value != pass2.value) {
	    	pass1.setCustomValidity("两次输入的密码不一致，请重新输入");
	    } else {
	    	pass1.setCustomValidity("");
	    }
    }
	function checkPasswords2() {
       	var pass1 = document.getElementById("pass1");
      		var pass2 = document.getElementById("pass2");
	    if (pass1.value != pass2.value) {
	    	pass1.setCustomValidity("两次输入的密码不一致，请重新输入");
	    } else {
	    	pass1.setCustomValidity("");
	    }
    }
</script>

